<script setup lang="ts">
import AssetListPicker from './asset-list-picker.vue';
import { AssetDto } from '../index';
const props = defineProps<{
  item: AssetDto;
}>();

/**
 * 请选择资产名称
 */
function selectAsset(
  assetTypeId: string,
  assetTypeName: string,
  assetId: string,
  assetName: string,
) {
  props.item.assetTypeId = assetTypeId;
  props.item.assetTypeName = assetTypeName;
  props.item.assetId = assetId;
  props.item.assetName = assetName;
}
</script>
<template>
  <nut-form>
    <nut-form-item label="资产名称" required>
      <asset-list-picker
        :selected-value="item.assetName"
        @on-change="selectAsset"
        placeholder="请选择资产名称"
      />
    </nut-form-item>
  </nut-form>
</template>
